<!-- 该servlet专门用于一些处理 ,返回值为JSON格式数据,利用eval进行处理      可以进行  update delete  insert 操作-->
<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<c:choose>
    <c:when test="${param.actionSerial == 0 }"><!-- 删除博文：        博文表   媒体表   附件表-->
      <nativeSql:sqlNjuptDelete sql="delete from t_article where f_id =  ${param.articleId }" id="status"/>
      <nativeSql:sqlNjuptDelete sql="delete from t_media where f_article_id =  ${param.articleId }" id="status"/>
      <nativeSql:sqlNjuptDelete sql="delete from t_article_mark where f_article_id =  ${param.articleId } " id="status"/> 
      <nativeSql:sqlNjuptDelete sql="delete from t_tag_mark where f_relate_entity_id =  ${param.articleId } " id="status"/>
      <!-- 对于附件的删除需要注意的是： 服务器上面的附件没有进行删除 ，数据库中记录的信息业没有删除，只不过将f_article_id设置为 -1,标志该数据已经被删除了。
                                     不真正删除的原因在于：便后以后进行数据的分析
      -->
      <nativeSql:sqlNjuptDelete sql="update  t_upload_file set f_article_id = -1 where f_article_id =  ${param.articleId } " id="status"/> 
	</c:when>
	
	 <c:when test="${param.actionSerial == 1 }">
	   <c:if test="${param.status == 0 }">
	     <nativeSql:sqlNjuptDelete sql="insert into t_article_mark(f_article_id,f_mark_time,f_marker_id) values( ${param.articleId },CURDATE(),${me.id }) " id="status"/>
	   </c:if>
	   <c:if test="${param.status == 1 }">
           <nativeSql:sqlNjuptDelete sql="delete from t_article_mark  where f_article_id = ${param.articleId } " id="status"/>
	   </c:if>
	 </c:when>
	 
	 <c:when test="${param.actionSerial == 2 }">
	     <nativeSql:sqlNjuptDelete sql="delete from t_article_comment where f_id =${ param.articleCommentId }" id="status"/>
	 </c:when>
	 
	 
	 <c:when test="${param.actionSerial == 3 }">
	     <c:if test="${param.status == 0 }">
	     <nativeSql:sqlNjuptDelete sql="insert into t_blog_mark(f_blog_id,f_mark_time,f_marker_id) values( ${param.blogId },CURDATE(),${me.id }) " id="status"/>
	   </c:if>
	   <c:if test="${param.status == 1 }">
           <nativeSql:sqlNjuptDelete sql="delete from t_blog_mark  where f_blog_id = ${param.blogId} " id="status"/>
	   </c:if>
	 </c:when>

</c:choose>
{status:"${status}"}